import Vue from 'vue'
import VueRouter from 'vue-router'
import AccountView from '@/views/accountinfo/AccountView.vue'
import UserView from '@/views/accountinfo/UserView.vue'
import CunView from '@/views/tradecode/CunView.vue'
import QuView from '@/views/tradecode/QuView.vue'
import ZhuanView from '@/views/tradecode/ZhuanView.vue'
import LoginView from '@/views/LoginView.vue'
import HomeView from '@/views/HomeView.vue'
// import LoginView from '@/views/LoginView.vue'

// import HomeView from '@/views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:'/login'
  },
  {  
    path: '/login',  
    name: 'login',  
    component:LoginView, // 使用 LoginLayout 组件作为登录页面的布局  
    // children: [  
    //   {  
    //     path: '',  
    //     component: Login // Login 组件渲染在 LoginLayout 的 <router-view /> 中  
    //   }  
    // ]  
  },  
  {  
    path: '/home',  
    name: 'home',  
    component: HomeView, // 使用 MainLayout 组件作为主内容的布局  
    children: [  
      {  
        path: '/',  
        redirect: '/accountinfo/account' // 假设默认跳转到存款记录  
      },
      {
        path: '/accountinfo/account',
        name: 'AccountView',
        component: AccountView
      },
      {
        path: '/accountinfo/user',
        name: 'UserView',
        component: UserView
      }, 
       {
        path: '/tradecode/cun',
        name: 'CunView',
        component: CunView
      },  
      {
        path: '/tradecode/qu',
        name: 'QuView',
        component: QuView
      }, 
      {
        path: '/tradecode/zhuan',
        name: 'ZhuanView',
        component: ZhuanView
      },
      // 其他需要渲染在 MainLayout <router-view /> 中的路由...  
    ]  
  }  
  // 其他路由... 
 
  // {
  //   path: '/about',
  //   name: 'about',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  // },
  

]

const router = new VueRouter({
  mode: 'history', 
  routes
})

export default router
